/*
 * @Author: Bennty
 * @Date: 2024-11-12 16:29:34
 * @LastEditors: 
 * @LastEditTime: 2024-11-15 15:35:58
 * @Description: 请填写简介
 */
import request from '@/utils/request';
import { QuerySemiProductrderType } from './types';
import { AxiosPromise } from 'axios';

/** 查询半成品单列表 */
export const getSemiProductOrderApi = (data:QuerySemiProductrderType ) => {
    return request({
        url: '/system/semiProduceOrder/list',
        method: 'post',
        data: data
    });
};

/** 半成品订单编辑详情 */
export const getSemiProductOrderDetails = (id: any) => {
    return request({
        url: `/system/semiProduceOrder/${id}`,
        method: 'get'
    });
};

/** 修改半成品单 */
export const editSemiProductOrderApi = (data: any) => {
    return request({
        url: '/system/semiProduceOrder',
        method: 'put',
        data: data
    });
};

/** 订单详情 */
export const checkOrderDetailApi = (id: any) => {
    return request({
        url: '/system/semiProduceOrder/getOrderDetail',
        method: 'get',
        params:{id: id}
    })
};

/** 用纸需求单纸张数据 */
export const getPaperInfoApi = (id: any) => {
    return request({
        url: '/system/semiProduceOrder/getPaperInfo',
        method: 'get',
        params:{id: id}
    })
};

/**删除半成品单 */
export const deleteSemiProductOrderApi = (id: any) => {
    return request({
        url: `/system/semiProduceOrder/${id}`,
        method: 'delete'
    });
};

/** 根据id查询调拨申请 */
export const checkPaperUseApi = (id: any) => {
    return request({
        url: `/system/semiProduceOrder/getPaperUseDetail`,
        method: 'get',
        params: {id: id}
    });
};

/** 新增用纸需求单 */
export const addSemiProductOrderApi = (data: any) => {
    return request({
        url: '/system/paperNeedOrder',
        method: 'post',
        data: data
    });
};

/** 新增纸张采购单 */
export const addPaperPurchaseOrderApi = (data: any) => {
    return request({
        url: '/system/paperPurchaseOrder',
        method: 'post',
        data: data
    });
};